
<script setup>
import { ref } from 'vue'
import { articleGetChannel } from '@/api/article'
const channelList = ref([])
defineProps({
  modelValue: {
    type: [Number, String]
  }
})
const emit = defineEmits(['update:modelValue'])
const getChannelList = async () => {
  const res = await articleGetChannel()
  channelList.value = res.data.data
}
getChannelList()


// channelList.value=res.data.data
// console.log(channelList.value);




</script>
<template>
  <el-select placeholder="请选择分类" style="width: 200px;" :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)">
    <el-option v-for="(item, index) in channelList" :key="item.id" :label="item.cate_name" :value="item.id"></el-option>
  </el-select>
</template>
<style lang="scss" scoped></style>